def get_error(func):
    def wrapper(*args, **kwargs):
        try:
            func(*args, **kwargs)
        except Exception as e:
            print("e:{}".format(e))
    return wrapper


class GetTargetUrl(object):
    __set_up_port = "8082"
    __set_up_ip = "10.9.242.44"
    _set_pic = ""

    def __init__(self):
        self.target_url = "192.168.0.1"
        self.agent_ip = "10.9.242.44"

    @staticmethod
    def __login_target(url, port):
        format_tuple = (url, port)
        print("private method {}{}".format(format_tuple[0], format_tuple[1]))

    @classmethod
    def test_method(cls):
        cls().__login_target(url="123", port="456")

    @get_error
    def test_case(self):
        print(self.target_url)
        self.agent_ip = "10.9.242.44"
        print([i for i in range(10) if i % 2 is 0])
        print((case for case in range(100) if case % 2 is not 0).__next__())
        print(self.__set_up_port)

    @classmethod
    def case_number(cls):
        cls().__login_target(url="123", port="456")
        format_tuple = (12, 10)
        print("{}{}".format(format_tuple[0], format_tuple[1]))


if __name__ == '__main__':
    gtr = GetTargetUrl()
    gtr.test_case()
    # gtr.test_method()
